#include "PassScene.h"
#include "logic/GameLogic.h"

using namespace cocos2d;


bool CPassLayer::init()
{
	if(!CCLayerColor::initWithColor(ccc4(41,57,85,255)))
		return false;

	CCSprite* pass = CCSprite::create("pass.png");
	pass->setPosition(ccp(540/2, 960/2));
	this->addChild(pass);

	CCSprite* pNormal = CCSprite::create("ok.png");
	CCSprite* pSelected = CCSprite::create("ok.png");
	//pNormal->setScale(2.5);
	//pNormal->setContentSize(pNormal->getContentSize()*2.5);
	pSelected->setScale(1.2);

	CCMenuItemSprite* item = CCMenuItemSprite::create(pNormal, pSelected,
		this, menu_selector(CPassLayer::onMenuOk));

	CCMenu* pMenu = CCMenu::create(item, NULL);
	pMenu->setAnchorPoint(ccp(0,0));
	pMenu->setPosition(ccp(0,0));
	item->setPosition(ccp(540/2, 50));

	this->addChild(pMenu);

	return true;
}

void CPassLayer::onMenuOk( cocos2d::CCObject* pSender )
{
	CGameLogic::shareInstance()->setState(EMainState::MENU_SCENE);
}

